const router = require('koa-router')()
const teamController = require('../controller/team')

/**
 * 自建数据库nba球队
 * @param {*} ctx 
 * @param {*} next 
 */
let getTeam = async (ctx, next)=>{
    let datalist = await teamController.getTeamList(ctx.query, ctx.header['x-wx-token'])
    ctx.body = datalist;
}
router.get('/team', getTeam)

/**
 * 直播8球队排名
 * @param {*} ctx 
 * @param {*} next 
 */
let getZb8Team = async (ctx, next) => {
    let datalist = await teamController.getZB8TeamList( ctx.header['x-wx-token'])
    ctx.body = datalist;
}
router.get('/zb8Team', getZb8Team)

/**
 * 腾讯nba赛程
 * @param {*} ctx 
 * @param {*} next 
 */
let getTencentGameList = async (ctx, next) => {
    let datalist = await teamController.getTencentGameList(ctx.query,ctx.header['x-wx-token'])
    ctx.body = datalist;
}
router.get('/tencentGame', getTencentGameList)

module.exports = router
